]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: separate out GtkNotification creation
authorCosimo Cecchi <cosimo@endlessm.com>
Thu, 11 Oct 2018 00:28:43 +0000 (17:28 -0700)
committerFlorian Müllner <florian.muellner@gmail.com>
Sat, 10 Nov 2018 10:56:49 +0000 (10:56 +0000)
This way, source subclasses can easily use a notification subclass
if different functionality is required.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/258

js/ui/notificationDaemon.js

index 81d3e3ae3c73bb06f69c09986986cafa802fd715..4d2be44edc40b22933c3e4805c973f0114729b32 100644 (file)
@@ -660,6 +660,10 @@ var GtkNotificationDaemonAppSource = new Lang.Class({
         return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback);
     },
 
+    _createNotification(params) {
+        return new GtkNotificationDaemonNotification(this, params);
+    },
+
     activateAction(actionId, target) {
         this._createApp((app, error) => {
             if (error == null)
@@ -688,7 +692,7 @@ var GtkNotificationDaemonAppSource = new Lang.Class({
         if (this._notifications[notificationId])
             this._notifications[notificationId].destroy();
 
-        let notification = new GtkNotificationDaemonNotification(this, notificationParams);
+        let notification = this._createNotification(notificationParams);
         notification.connect('destroy', () => {
             delete this._notifications[notificationId];
         });